package com.lanxiaoye.shoppingSystem.dao;


import com.lanxiaoye.shoppingSystem.common.exception.EmptyException;
import com.lanxiaoye.shoppingSystem.common.page.HistoryPage;
import com.lanxiaoye.shoppingSystem.common.page.Page;
import com.lanxiaoye.shoppingSystem.entity.MessageActivity;
import com.lanxiaoye.shoppingSystem.common.exception.BaseException;
import com.lanxiaoye.shoppingSystem.entity.OwnEntity;
import com.lanxiaoye.shoppingSystem.entity.User;

import java.util.List;

/**
 * Created by libing on 2016/12/13.
 */
public interface HomeIndexMapper {
    //根据电话号码返回用户信息
    public User getUserInfo(User user)throws BaseException,EmptyException;
    //根据电话号码返回信息活动表中的信息
    public MessageActivity getMessageActivity(User user)throws BaseException,EmptyException;
    //根据user_id返回用户信息
    public User getUser(Integer user_id)throws BaseException,EmptyException;
    //根据电话号码返回消息数量
    public int getMessageNum(User user)throws BaseException,EmptyException ;
    //根据电话号码得到是否有搜索的历史
    public int getSearchHistory(User user)throws BaseException,EmptyException;
    //根据电话号码返回前三搜索次数最多的记录
    public List<String> getMostLikeSearch(HistoryPage page)throws BaseException,EmptyException;
    //根据搜索记录返回商家,history已经封装成了'%XXX%'格式
    public OwnEntity getOwnEntity(String history)throws BaseException,EmptyException;
    //按分页的形式返回商家
    public List<OwnEntity> getOwnEntityList(Page page)throws BaseException,EmptyException;
    //返回商家数量
    public int getOwnNumbers(Page page)throws BaseException,EmptyException;
}
